<?php
class RecordListAction extends Action{
	
	public function main(){
		$obj = new  RecordTaskDAO();
		$selected = new Selected();
		$channelid = (int)$this->_request['channelid'];
		$classid = (int)$this->_request['classid'];
		//debug($channelid);
		if(!$channelid){
			$ret = $obj->getList();
		}else{
			$ret = $obj->getListbyChannelID($channelid);
		}
		if ($ret) {
			for ($i=0; $i < count($ret); $i++) { 
				$ret[$i]['TaskStatusShow'] = $selected->getVal("TaskStatus",$ret[$i]['TaskStatus']);
				$ret[$i]['ClassID'] = $classid;
			}
		}	

		$this->_response['ret'] = $ret;
		$this->_response['ChannelID'] = $channelid;
		//debug($this->_response['ret']);
	}

}